home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 4441 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.1 KB

  1. Path: sn.no!orjarive
  2. From: jakob.rivertz@aftenposten.no (Jakob Rivertz)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Strange guru
  5. Date: Thu, 29 Feb 96 06:52:34 GMT
  6. Organization: Aftenposten A/S
  7. Message-ID: <4h3ivo$966@hasle.sn.no>
  8. References: <4gscv0$ovd@brachio.zrz.TU-Berlin.DE>
  9. NNTP-Posting-Host: gatekeeper.aftenposten.no
  10. X-Newsreader: News Xpress 2.0 Beta #0
  11.  
  12. In article <4gscv0$ovd@brachio.zrz.TU-Berlin.DE>, 
  13. rawneiha@hydra.zrz.TU-Berlin.DE (Philipp Boerker) wrote:
  14. >
  15. >My amiga is constantly surprising me with a strange guru:
  16. >
  17. >I did some coding, the code crashes when exiting with guru $87000004
  18. >which translates as "did not expect a packet (dos.library)".
  19. >
  20. >                                              But that's not all:
  21. >whenever I start it via shell or Arexx/DosCommand it does not crash,
  22. >whenever I start it via doubleclick on the icon it does!
  23.  
  24. [As I have not programmed an Amiga in two years, this answere may
  25. no longer be valid.] I did see this error when I was writing some
  26. programs and attempted to use the process->pr_MsgPort field for
  27. general message communication (don't mess with it, it is actually
  28. reserved for WB/dos).
  29.  
  30. This guru is generated when a dos.library function is called, and
  31. it senses a packet in the process->pr_MsgPort list when no message
  32. was expected. Remember that dos.library uses a simple master/slave
  33. scheme, ie. a dos function call generates a packet to a handler,
  34. and the handler returns a reply. It confuses dos to see something
  35. that looks like a reply, before a request has been sent. The amiga
  36. is good, but it's not a mind-reader. Yet! ;-).
  37.  
  38. I would assume that dos.library locates the WB Startup message in
  39. the process->pr_MsgPort list. This message is only sent when WB
  40. starts the program, never when the program is started from a CLI.
  41.  
  42. Do a GetMsg() on process->pr_MsgPort when your program starts. If
  43. it returns non-NULL, then hold onto this message until your code can
  44. exit. Then reply the message. WB will then UnLoadSeg() your code.
  45. Actually the standard C startup code should do this for you, but for
  46. some reason or other it doesn't. You do link with the C startup code?
  47.  
  48. -- 
  49. Jakob <jakob.rivertz@aftenposten.no>
  50.